%li.highlight[related]
  - unless related.category.blank?
    .strip{class: related.category}= t(related.category)
  - else
    .strip.other #{t :other}
  %div
    - if related.assigned_to
      = link_to(related.assignee.full_name, user_path(related.assignee))
    - else
      = link_to(related.user.full_name, user_path(related.user))
    = ": " + related.name
    - if related.asset_id?
      == (#{t :related} #{link_to(related.asset.name, polymorphic_url(related.asset))})
    &ndash;
    %tt
      - if related.completed_at
        %span.cool
          = t(:task_completed_ago, distance_of_time_in_words(related.completed_at, Time.now))
      - elsif related.bucket == "due_asap"
        %span.urgent
        == #{t :due_now}.
      - elsif related.bucket == "due_later"
        == #{t :due_later}.
      - elsif related.due_at < Date.today
        %span.warn= distance_of_time_in_words(related.due_at, Date.today)
        == #{t :overdue} #{related.due_at.strftime('%b %e')}
      - elsif related.due_at > Date.today
        = t(:task_due_in, distance_of_time_in_words(Time.now, related.due_at.end_of_day))
      - else
        %span.cool
        == #{t :due_today}.

